package com.example.demo.intf;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.example.demo.entity.LoginUser;
import com.example.demo.error.TestHystric;

/**
 * @author 88377761
 *
 */
@FeignClient(value = "user-admin", fallback = TestHystric.class)
public interface TestInterface {
	// https://blog.csdn.net/acmman/article/details/100595666
	// @HystrixCommand(fallbackMethod = "test",commandProperties = {
	// @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",
	// value = "400"), // 指定多久超时，单位毫秒。超时进fallback
	// @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value =
	// "10"), // 判断熔断的最少请求数，默认是10；只有在一个统计窗口内处理的请求数量达到这个阈值，才会进行熔断与否的判断
	// @HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value =
	// "10"),// 判断熔断的阈值，默认值50，表示在一个统计窗口内有50%的请求处理失败，会触发熔断
	// })
	@PostMapping(value = "/test")
	String test(String name);

	@PostMapping(value = "/test2")
	String test2(@RequestBody LoginUser user);
}
